package controllers;

import java.io.IOException;

import ccrm.ClientMain;
import entitys.AddressSale;
import entitys.Request;
import entitys.Session;
import enums.Command;

public class AddReportController {
	/**
	 * Request product list from server by marketing sale id.  
	 */
	public static void getProducts(String marketingSaleID)
	{
		Request r =new Request(Command.GET_PRODUCTS_BY_MARKETING_SALE,Session.getEmployee().getUserId(),marketingSaleID);
		try {
			ClientMain.client.sendToServer(r);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	/**
	 * Request server to add sale by addressing. 
	 */
	public static void addAddressSale(int sold, int productID, int customerID, String employeeID,String Review, String marketingSaleID)
	{
		Request r =new Request(Command.ADD_ADDRESS_SALE,Session.getEmployee().getUserId(),new AddressSale(sold, productID, customerID, Session.getEmployee().getUserId(), Review,marketingSaleID));
		try {
			ClientMain.client.sendToServer(r);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
